<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<#include "../../base/_meta.html"> 
<@head>
<script type="text/javascript">
	var eee;
	var dialog = frameElement.dialog;
	$(function() {		
		$.metadata.setType("attr", "validate");
        var v = $("form").validate({
            debug: true
        });
        $("form").ligerForm();
	});
	// Save
	function doSave(){
		var form = liger.get('form_edit');
        if (!form.valid()) {
       	 return;
        }
		$.ajax({
			url:"/ddesign/diagram/save",
			data:$("#form_edit").serialize(),
			success:function(msg){
	        	if(msg == "1"){
	        		parent.window.relaodTree();// Rfresh grid of users
	        		$.ligerDialog.confirm('保存成功，继续添加或修改数据？', 
	        				function (yes) {
	        				if(!yes){
	        					dialog.close();	
	        				}
	        			});
	        		
	        	}else{
	        		$.ligerDialog.error(msg); 
	        	}
	    	}
		});	
	}
</script>
<style type="text/css">
 body{ font-size:12px;}
 .l-table-edit {}
 .l-table-edit-td{ padding:4px;}
 .l-button-submit,.l-button-test{width:60px; float:center}
 .l-verify-tip{ left:230px; top:120px;}
</style>
</@head>
<body style="overflow-x: hidden; padding: 2px;">
 <form id="form_edit" class="liger-form" data-validate="{}"> 
	<input type="hidden" name="screen" id="screen" value="${(screen)!}"/>
	<input type="hidden" name="projectid" id="projectid"" value="${(projectid)!}"/>
	<table cellpadding="0" cellspacing="0" class="l-table-edit" width="100%" >
		<tr>
			<td align="right" class="l-table-edit-td" >项目名称:</td>
			<td align="left" class="l-table-edit-td" style="width: 160px">
				${(projectname)!}
			</td>
			<td align="left"></td>
			<td align="left"></td>
		</tr>
		<tr>
			<td align="right" class="l-table-edit-td" >图表名称:</td>
			<td align="left" class="l-table-edit-td" style="width: 160px">
			<input
				name="diagramname" type="text" id="diagramname" ltype="text"
				validate="{required:true,minlength:3,maxlength:100}" value="${(diag.diagramname)!}"/>
			<#if screen == "E">
			<input
				name="diagramid" type="hidden" id="diagramid" value="${(diag.diagramid)!}"/>
			</#if>
			</td>
			<td align="left"></td>
			<td align="left"></td>
		</tr>
		<tr>
           <td align="right" class="l-table-edit-td">备注描述:</td>
           <td align="left" class="l-table-edit-td" colspan="2" > 
           <textarea name="remark" id="remark" cols="40" rows="7" 
           			class="l-textarea"  style="width:400px">${(diag.remark)!}</textarea>
           </td> <td align="left"></td>
       </tr>
		<tr>
		     <td align="center" colspan="4" width="500">
			<input type="button" value="保存" class="l-button l-button-test" onclick="doSave();"/>
		   </td>
      </tr>
	</table>
</form>
<script type="text/javascript">
// if has radio,select,checkbox,put here for init
</script>
</body>
</html>